{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "75b9f930",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(342, 548, 3) (410, 658, 3) (171, 274, 3)\n"
     ]
    }
   ],
   "source": [
    "import cv2 as cv\n",
    "import numpy as np\n",
    "\n",
    "img = cv.imread('../data/messi5.jpg')\n",
    "\n",
    "#params calculation\n",
    "scaleUp, scaleDown = 1.2, 0.5\n",
    "scaleUWidth = round(img.shape[1]*scaleUp)\n",
    "scaleUHeight = round(img.shape[0]*scaleUp)\n",
    "scaleDWidth = round(img.shape[1]*scaleDown)\n",
    "scaleDHeight = round(img.shape[0]*scaleDown)\n",
    "\n",
    "imgScaledU = cv.resize(img,(scaleUWidth, scaleUHeight),interpolation = cv.INTER_CUBIC)\n",
    "imgScaledD = cv.resize(img,(scaleDWidth, scaleDHeight),interpolation = cv.INTER_CUBIC)\n",
    "print(img.shape, imgScaledU.shape, imgScaledD.shape)\n",
    "\n",
    "cv.imshow(\"org\", img)\n",
    "cv.imshow(\"scaledU\", imgScaledU)\n",
    "cv.imshow(\"scaledD\", imgScaledD)\n",
    "cv.waitKey(0)\n",
    "\n",
    "cv.destroyAllWindows()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c9a3ce9d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
